package lab03.test03;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test {

    public static void main(String[] args) {

        String path = "D:\\test.txt";

        //字节流 写文件
         FileOutputStream fileOutputStream=null;
        try {
             fileOutputStream=new FileOutputStream(path);

            //10101011 字节
            fileOutputStream.write("Beijing欢迎你！".getBytes());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                fileOutputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }

        }





    }
}



